A replay attack (also known as playback attack, freshness attack, man-in-the-middle attack) is a form of network attack in which a valid data transmission is maliciously or fraudulently repeated or delayed. This may be carried out by the originator of the transmission to a node (e.g., server) or by an adversary who intercepts the data and re-transmits it to the node. For example, replay attack may be carried out as part of a masquerade attack by Internet Protocol (IP) packet substitution. Another way of describing replay attack is: an attack on a security protocol using replay of messages from a different context into the intended (or original and expected) context, thereby fooling the honest node(s) into thinking they have successfully completed the protocol run. For example, the protocol may be a blockchain transaction protocol. A blockchain may branch into two or more sub-chains which follow the same address, encryption key, and transaction system. A legitimate transaction on one sub-chain may be maliciously repeated on another sub-chain by a replay attack, causing loss to the sender.
Though blockchain is advantageous for various advantages over traditional networks, it is nonetheless susceptible to replay attacks. For example, a transaction sending 20 ethers from A to B through blockchain can be repeated by B in replay attacks to continually drain A's balance. Thus, replay attack detection is critical for fending off malicious blockchain operations and safekeeping personal properties.